var LogApp = function(){
	return{
		init:function(){
			LogApp.loadGrid();
		},
		loadGrid:function(){
    		var url = $("#APP_ROOT_PATH").val() + 'oper_log/page_data';
    		gui.widgets.BootStrap.loadGrid({
                gridSelector:"#grid-table",
                pagerSelector:"#grid-pager",
                postData:{
                	ownerName:function(){
                		return $.trim($("#ownerName").val());
                	},
                	type:function(){
                		return $.trim($("#type").val());
                	}
                },
                jsonReader : {
                    root: "data.rows",
                    records: "data.total",
                    repeatitems : false,
                    total: function (obj) {
                        return  Math.ceil(obj.data.total /jQuery("#grid-table").getGridParam("rowNum"));
                    }
                } ,
                datatype: 'json',
                url:url,
                colNames:['操作人','操作时间','操作类型','操作内容'],
                colModel:[{name:'ownerName'},
                          {name:'gmtCreate'},
                          {name:'type',formatter:function(value){
                        	  if(value == '2')return '商家日志';
                        	  if(value == '3')return '会员日志';
                        	  if(value == '4')return '登录日志';
                          }},
                          {name:'content'}
                ],
                caption: "日志信息",
                rowList:[10,20,30],
                multiselect: true,
                prmNames:{
                    page:"pageNum",
                    rows:"pageSize",
                    sort: "sortField",
                    order: "sortOrder",
                    search:"_search"
                }
            });
    	},
    	reload:function(){
    		jQuery("#grid-table").jqGrid('setGridParam',{page:1}).trigger("reloadGrid");
    	},
    	reset:function(){
    		$("#ownerName").val('');
    		$("#type").val('');
    	}
	}
}();